An increasing of products are incorporating microprocessors. Much of the development cost of these products is related to the testing and debugging of the programs executed by the microprocessor. Also, the performance of the resulting product may depend heavily upon the various design choices made and the skill employed in writing those programs. That programming may be in the form of firmware of software; as far as the description below is concerned the difference is moot, and such programming will hereinafter be referred to simply as software.
Any new product that relies heavily on software to accomplish its intended function goes through a development cycle during which designers depend on a variety of measurement tools (e.g., emulators, timing analyzers, logic state analyzers and the like) to test, debug, and analyze the product's performance. The instant invention is an additional measurement tool that aids designers in nearly every phase of the software development cycle. It can be used for software characterization, testing, debugging, and optimization, and can characterize software nonintrusively as that software executes in real time.
Traditionally, program performance has been measured in one of two ways: through in-program "hooks," which print out a short message every time the block of code in which they reside is executed, or by custom designed monitoring programs, which oversee the execution of the target code and measure the duration of execution. The main drawback of both traditional methods is that they are intrusive and affect real-time operation. In-program hooks lengthen the program under test and must be removed if the finished code is to fit in a restricted memory space. Once removed, however, they are no longer available to monitor code execution. Therefore, for every debugging effort the hooks must be regenerated; a difficult and costly task. Similarly, program monitors, whether they be line-by-line tracers or event timers, add their own execution time to that of the program. As a consequence, they are not well suited to situations that require real detective work across a wide spectrum of module interaction. A further disadvantage of these traditional methods is that they must be specifically tailored to each measurement to be performed, a time consuming and possibly error prone programming task in itself.
In contrast, the software performance analyzer disclosed herein can perform six separate nonintrusive measurements: program activity, memory activity, module duration, module usage, intermodule duration, and intermodule linkage. Each measurement permits different insights into software performance. Data is collected, analyzed, and updated continuously, providing a sizable data base for statistical analysis. Measurement results, displayed in either histogram or tabular format, can be used by the analyzer for statistical analysis of data.
Data collection parameters are entered quickly and easily with directed-syntax softkeys. Symbols and labels generated in program assembly or compilation can be used directly in defining measurements. Measurement configurations are flexible, meeting a variety of application requirements. The software performance analyzer can be specified to provide, for example, a global view of the entire memory space divided into 12 address ranges, or more detailed analysis, as in showing how frequently a subroutine is called by another subroutine. Measurements may be initiated and terminated manually, or automatically by setting enable/disable conditions. Alternatively, windows can be defined for repetitive data collection in a defined code segment for situations requiring context recognition.
These and other aspects of the invention are achieved by identifying the address boundaries of each module or portion of memory that is of interest to an activity measurement, and creating in a RAM a list of those ranges thus defined. A microprocessor randomly selects a starting point in the list and configures a programmable range detector to represent the selected range. Address information from the target system under test is applied to the range detector, whose output is applied to a state machine. The state machine also receives target system status information. The rules embodied by the state machine are measurement dependent, and are selected under the control of the microprocessor. The state machine responds to sequences of events in the target system under test by producing various control signals applied to some reconfigurable counter circuitry. The configuration of the counter circuitry is also responsive to the microprocessor. The counts accumulated by the configured counters are captured after a preselected amount of time (or perhaps a preselected number of occurrences of a predefined event on the bus of the target system) and are incorporated into the overall measurement results. The next range in the list is then applied to the range detector and the process continues until the entire list has been used. The list is reused with another randomly chosen range as the starting point, and so on, until the measurement is complete.
Duration and usage measurements are similar, except that only one module or the interim between two modules is specified. Associated with either are simply a start address and a stop address. A list of possible time ranges is specified. In these measurements the range detector is loaded with the range whose boundaries are the start and stop addresses. The counters are configured to acquire the number of times the associated time interval falls within a randomly selected element of the list of time ranges. After a preselect amount of time the counters are reconfigured to represent the next time range in the list. After each such change the acquired data is incorporated into the overall measurement, and the process continues until the complete list has been used. The list is re-used, with another randomly chosen starting point, and so on, until the measurement is completed.
The intermodule linkage measurement is made in a similar fashion. The state machine is equipped with a suitable rule of operation for exerting the counter control lines and the counters configured in a correspondingly suitable manner.